<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>产品分类管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {		
			$("#contentTable tbody tr").on("click",function(){
				$("#contentTable tbody tr").removeClass("select_active");
				$(this).addClass("select_active");
				var url = "${ctx}/expert/product/list?category_id=" + this.id;
				window.location.href = url;
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<div data-role="navbar">
	    <ul>
	        <li><a href="${ctx}/expert/productCategory/" class="ui-btn-active">系统产品</a></li>
	        <li><a href="${ctx}/base/storeSelfProductCategory/">店面自营产品</a></li>
	    </ul>
	</div>
	<div class="icon-buttons">
		<input type="button" class="leave-clean-session" data-inline="true" data-icon="back" data-iconpos="notext" value="返回"/>
	</div>
	<form:form id="searchForm" modelAttribute="productCategory" action="${ctx}/expert/productCategory/" method="post">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>按产品分类名称查询 ：&nbsp;&nbsp;</label>
		<input type="search" id="productCategoryName" name="productCategoryName" value="${productCategoryName}"/>
		<input id="btnSubmit" type="submit" value="查询" data-inline="true"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" data-role="table" class="ui-responsive table-stroke">
		<thead><tr><th>产品分类名称</th><th>产品类别</th><th>描述</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="productCategory">
			<tr id='${productCategory.id}' >
				<td>${productCategory.name}</td>
				<td>${fns:getDictLabel(productCategory.type, "product_sell_type", "")}</td>
				<td class="description">${productCategory.description}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
